﻿

using System;
using System.Collections.Generic;
using System.Text;

namespace AbstractFactoryPattern.Shape
{
    public class ShapeFactory : AbstractFactory
    {

        #region 工厂函数
        /// <summary>
        /// 工厂函数
        /// </summary>
        /// <param name="flag"></param>
        /// <returns></returns>
        public override object  GetObject(string flag) =>
          flag switch
          {
              "Round" => new Round(),
              "Square" => new Square()
          };
        #endregion 

    }
}
